package com.example.design;

import java.time.LocalDate;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @author spshi
 */
public class DateUtils {

    public static final ZoneOffset ZONE_OFFSET = ZoneOffset.of("+8");
    public static final DateTimeFormatter FORMAT_YYYYMMDD = DateTimeFormatter.ofPattern("yyyyMMdd");

    public static Date localDate2Date(LocalDate localDate) {
        return new Date(localDate.atStartOfDay().toEpochSecond(ZONE_OFFSET) * 1000L);
    }

}
